#include"time.h"
#include"stdio.h"
main()//唐子豪
{
    int tol=0;
    printf("\n* * * * * * *catch thirty * * * * * * * \n");
    printf("Gmae Begin\n");
    randomize();
    if(random(2)==1)
        tol=input(tol);
    while(tol!=30)
        if((to;=copu(tol))==30)
            printf("You lose!\n");
        else
            if((tol=input(tol))==30)
                printf("I lose!\n");
    printf("* * * * * * * * * * *Game Over* * * * * * * * *\n");

}
input(t)
    int t;
{
    int a;
    do{
        printf("Please count:");
        scanf("%d",&a);
        if(a>2||a<1||t+a>30)
            printf("Error Input,again!");
        else    
            printf("You count:%d\n",t+a);

    }while(a>2||a<1||t+a>30);
    return(t+a);


}
copu(s)
    int s;
{
    int c;
    printf("Computer count:");
    if((s+1)%3==0)
        printf(" %d\n",++s);
    else if((s+2)%3==0){
        s+=2;
        printf(" %d\n",s);

    }
    else{
        c=random(2)+1;
        s+=c;
        printf(" %d\n",s);

    }
    return(s);
}